{include file="public/nheader"}
<div class="layui-fluid layui-bg-white">
    <form action="{:url()}" class="layui-form layui-form-fixed">
        <div class="layui-form-item">
            <label class="layui-form-label">
                <font color="red">* </font>品牌
            </label>
            <div class="layui-input-block">
                <select name="type" lay-verify="">
                    <option value="">选择品牌</option>
                    {foreach $pinpai as $pai}
                    <option value="{$pai.type}" {if !empty($row['type']) && $row['type']==$pai.type}selected
                        disabled{/if}>{$pai.pinpai}
                        {/foreach}
                    </option>
                </select>
            </div>

        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">
                <font color="red">* </font>是否有效
            </label>
            <div class="layui-input-block">
                {if !empty($row.labellist) && count($row.labellist) > 0}
                {foreach $row.labellist as $list}
                <input type="checkbox" name="values[]" value="{$list.id}" title="{$list.labelName}" {if
                    $list.status==1}checked{/if}>
                {/foreach}
                {else}
                无
                {/if}
                <div style="color: red;">勾选表示有效，取消勾选表示无效</div>
            </div>
        </div>
        <div class="layui-footer layui-form-item layui-center ">
            <input type="hidden" value="{$row.id|default='0'}" name="id" />
            <button class="layui-btn" lay-filter="submitIframe" type="button" lay-submit>提交</button>
            <button class="layui-btn layui-btn-primary" type="button" sa-event="closeDialog">取消</button>
        </div>
    </form>
</div>
{include file="public/nfooter"}
<script>
    layui.use(['form', 'layer'], function () {
        $ = layui.jquery;
        var form = layui.form
            , layer = layui.layer;
        form.on('checkbox(father)', function (data) {
            if (data.elem.checked) {
                $(data.elem).parent().next('div').find('input').prop("checked", true);
                form.render();
            } else {
                $(data.elem).parent().next('div').find('input').prop("checked", false);
                form.render();
            }
        });
    });
</script>